//
// Created by zing on 5/24/2020.
//

#ifndef LEARN_CPP_EXERCISE7_2_H
#define LEARN_CPP_EXERCISE7_2_H

#include <string>

using namespace std;

struct Sales_data {
    string isbn() const { return bookNo; };

    Sales_data &combine(const Sales_data &);

    string bookNo;
    unsigned units_sold = 0;
    double revenue = 0.0;
};

Sales_data &Sales_data::combine(const Sales_data &rhs) {
    units_sold += rhs.units_sold;
    revenue += rhs.revenue;
    return *this;
}

#endif //LEARN_CPP_EXERCISE7_2_H
